var express = require('express');
var router = express.Router();
var request = require('superagent');
var cheerio = require('cheerio');


/* 规定:
 * request 为爬虫请求
 * response 为爬虫返回
 * req 为项目请求
 * res 为项目响应
 * */


router.get('/', function (req, res, next) {
    var url = 'https://www.ele.me/place/wtw27pnxv422';

    request.get(url)
        .end(function (err, response) {
            if (err) {
                return next(err);
            }
            console.log(response);
            res.send(response.text)
        });
});

module.exports = router;
